<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>RegistryDLL: Snake luokkareferenssi</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generoinut Doxygen 1.7.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Pääsivu</span></a></li>
      <li><a href="namespaces.html"><span>Nimiavaruudet</span></a></li>
      <li class="current"><a href="annotated.html"><span>Luokat</span></a></li>
      <li><a href="files.html"><span>Tiedostot</span></a></li>
    </ul>
  </div>
  <div class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Luokkalista</span></a></li>
      <li><a href="classes.html"><span>Luokkaluettelo</span></a></li>
      <li><a href="functions.html"><span>Luokan&nbsp;jäsenet</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Julkiset jäsenfunktiot</a> &#124;
<a href="#pri-attribs">Yksityiset attribuutit</a>  </div>
  <div class="headertitle">
<h1>Snake luokkareferenssi</h1>  </div>
</div>
<div class="contents">
<!-- doxytag: class="Snake" -->
<p><code>#include &lt;<a class="el" href="snake_8h_source.html">snake.h</a>&gt;</code></p>

<p><a href="class_snake-members.html">Lista kaikista jäsenistä.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Julkiset jäsenfunktiot</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a32b3531dd5974b8d157fcbb84b490e52">Snake</a> (int x, int y)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a941fbaad96ee33ca3a7c30c28ca44ef8">~Snake</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a70633b60e38c1b03358e9292a32fa3c7">move</a> (int x, int y)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a8251b1fc68c632af86eef620256aec1f">collision</a> (<a class="el" href="class_block.html">Block</a> *block)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a1e6804b6419b1f2da16c3e36be6375d9">addLength</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#af79498343f5f511cfb86dbe7048a1f85">outsideRectangle</a> (int x1, int y1, int x2, int y2)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#ad9b10a9f3914b7792cd4965b3749ff0b">collisionWithItself</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a2965f55d60072c86491838576632dff7">getX</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#aa7866f47e038de296484caaea8c8f023">getY</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#aa34f490538ed582a33c9aded6c226a7f">setDirection</a> (int dir)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a5519357feed2e856db854db96ba653db">getDirection</a> (void)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#adac9182b065f945a8ea1114a3d03e284">draw</a> (HDC hdc, int x, int y)</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Yksityiset attribuutit</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a1349ccf7f145382b601ac41927f84af4">direction</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#aba2f9d9cbf10b4be4887e5bc9612bfde">length</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_block.html">Block</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_snake.html#a9b1b4e890de54b0fe8fdff0e9f641612">blocks</a> [100]</td></tr>
</table>
<hr/><a name="_details"></a><h2>Yksityiskohtainen selite</h2>
<p>Pelaajan ohjaaman madon toteuttava luokka. </p>
<dl class="author"><dt><b>Tekijä:</b></dt><dd>Henrik Ojanen </dd></dl>
<hr/><h2>Rakentajien &amp; purkajien dokumentaatio</h2>
<a class="anchor" id="a32b3531dd5974b8d157fcbb84b490e52"></a><!-- doxytag: member="Snake::Snake" ref="a32b3531dd5974b8d157fcbb84b490e52" args="(int x, int y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Snake::Snake </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Muodostinfunktio. Asettaa aloitussijainnin. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>x</em>&nbsp;</td><td>x-koordinaatti </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>y</em>&nbsp;</td><td>y-koordinaatti </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a941fbaad96ee33ca3a7c30c28ca44ef8"></a><!-- doxytag: member="Snake::~Snake" ref="a941fbaad96ee33ca3a7c30c28ca44ef8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">Snake::~Snake </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tuhoaja. </p>

</div>
</div>
<hr/><h2>Jäsenfunktioiden dokumentaatio</h2>
<a class="anchor" id="a1e6804b6419b1f2da16c3e36be6375d9"></a><!-- doxytag: member="Snake::addLength" ref="a1e6804b6419b1f2da16c3e36be6375d9" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Snake::addLength </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Lisää palikkajonon pituutta yhdellä. </p>

</div>
</div>
<a class="anchor" id="a8251b1fc68c632af86eef620256aec1f"></a><!-- doxytag: member="Snake::collision" ref="a8251b1fc68c632af86eef620256aec1f" args="(Block *block)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Snake::collision </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_block.html">Block</a> *&nbsp;</td>
          <td class="paramname"> <em>block</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tarkistaa, törmääkö madon ensimmäinen palikka annetun palikan kanssa. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>block</em>&nbsp;</td><td>testattava palikka </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>tapahtuiko törmäystä </dd></dl>

</div>
</div>
<a class="anchor" id="ad9b10a9f3914b7792cd4965b3749ff0b"></a><!-- doxytag: member="Snake::collisionWithItself" ref="ad9b10a9f3914b7792cd4965b3749ff0b" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Snake::collisionWithItself </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Törmääkö ensimmäinen palikka muiden palikoiden kanssa. </p>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>totuusarvo </dd></dl>

</div>
</div>
<a class="anchor" id="adac9182b065f945a8ea1114a3d03e284"></a><!-- doxytag: member="Snake::draw" ref="adac9182b065f945a8ea1114a3d03e284" args="(HDC hdc, int x, int y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Snake::draw </td>
          <td>(</td>
          <td class="paramtype">HDC&nbsp;</td>
          <td class="paramname"> <em>hdc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Piirtää kaikki palikat suorakulmion sisään, jonka vasen yläkulma on annetuissa koordinaateissa. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>hdc</em>&nbsp;</td><td>kahva piirrettävään kohteeseen </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>x</em>&nbsp;</td><td>origon x </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>x</em>&nbsp;</td><td>origon y </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="a5519357feed2e856db854db96ba653db"></a><!-- doxytag: member="Snake::getDirection" ref="a5519357feed2e856db854db96ba653db" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Snake::getDirection </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Palauttaa suunnan. </p>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>direction-jäsenmuuttujan arvo </dd></dl>

</div>
</div>
<a class="anchor" id="a2965f55d60072c86491838576632dff7"></a><!-- doxytag: member="Snake::getX" ref="a2965f55d60072c86491838576632dff7" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Snake::getX </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Palauttaa ensimmäisen palikan x-koordinaatin </p>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>palikan x </dd></dl>

</div>
</div>
<a class="anchor" id="aa7866f47e038de296484caaea8c8f023"></a><!-- doxytag: member="Snake::getY" ref="aa7866f47e038de296484caaea8c8f023" args="(void)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int Snake::getY </td>
          <td>(</td>
          <td class="paramtype">void&nbsp;</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Palauttaa ensimmäisen palikan y-koordinaatin </p>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>palikan y </dd></dl>

</div>
</div>
<a class="anchor" id="a70633b60e38c1b03358e9292a32fa3c7"></a><!-- doxytag: member="Snake::move" ref="a70633b60e38c1b03358e9292a32fa3c7" args="(int x, int y)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Snake::move </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Siirtää matoa suhteessa entiseen sijaintiin. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>x</em>&nbsp;</td><td>suhteellinen x-koordinaatti </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>y</em>&nbsp;</td><td>suhteellinen y-koordinaatti </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="af79498343f5f511cfb86dbe7048a1f85"></a><!-- doxytag: member="Snake::outsideRectangle" ref="af79498343f5f511cfb86dbe7048a1f85" args="(int x1, int y1, int x2, int y2)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool Snake::outsideRectangle </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>x2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>y2</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tarkistaako, onko ensimmäinen palikka annetun suorakulmion ulkopuolella. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>x1</em>&nbsp;</td><td>suorakulmion vasemman yläkulman x-koordinaatti </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>y1</em>&nbsp;</td><td>suorakulmion vasemman yläkulman y-koordinaatti </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>x2</em>&nbsp;</td><td>suorakulmion oikean alakulman x-koordinaatti </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>y2</em>&nbsp;</td><td>suorakulmion oikean alakulman y-koordinaatti </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Palauttaa:</b></dt><dd>totuusarvo </dd></dl>

</div>
</div>
<a class="anchor" id="aa34f490538ed582a33c9aded6c226a7f"></a><!-- doxytag: member="Snake::setDirection" ref="aa34f490538ed582a33c9aded6c226a7f" args="(int dir)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Snake::setDirection </td>
          <td>(</td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>dir</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Asettaa suunnan. </p>
<dl><dt><b>Parametrit:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>dir</em>&nbsp;</td><td>uusi suunta </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Jäsendatan dokumentaatio</h2>
<a class="anchor" id="a9b1b4e890de54b0fe8fdff0e9f641612"></a><!-- doxytag: member="Snake::blocks" ref="a9b1b4e890de54b0fe8fdff0e9f641612" args="[100]" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_block.html">Block</a>* <a class="el" href="class_snake.html#a9b1b4e890de54b0fe8fdff0e9f641612">Snake::blocks</a>[100]<code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Taulukko palikoiden varastoimiseen. </p>

</div>
</div>
<a class="anchor" id="a1349ccf7f145382b601ac41927f84af4"></a><!-- doxytag: member="Snake::direction" ref="a1349ccf7f145382b601ac41927f84af4" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_snake.html#a1349ccf7f145382b601ac41927f84af4">Snake::direction</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Suuntamuuttuja, jonka perusteella tarkistetaan, ettei liikuta samaan suuntaan, josta ollaan tulossa. </p>

</div>
</div>
<a class="anchor" id="aba2f9d9cbf10b4be4887e5bc9612bfde"></a><!-- doxytag: member="Snake::length" ref="aba2f9d9cbf10b4be4887e5bc9612bfde" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_snake.html#aba2f9d9cbf10b4be4887e5bc9612bfde">Snake::length</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Palikkajonon pituus. </p>

</div>
</div>
<hr/>Dokumentaatio tälle luokalle luotiin seuraavista tiedostoista:<ul>
<li>C:/Users/ojanhenr/winPeliSVN/winPeli/<a class="el" href="snake_8h_source.html">snake.h</a></li>
<li>C:/Users/ojanhenr/winPeliSVN/winPeli/<a class="el" href="snake_8cpp.html">snake.cpp</a></li>
</ul>
</div>
<hr class="footer"/><address class="footer"><small>Generoinut projektille RegistryDLL Tue Apr 12 2011 10:05:31 &nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address>
</body>
</html>
